Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8255216: Change _directive->BreakAtCompileOption to env()->break_at_compile() #1806

Closed
wants to merge 5 commits into from

Conversation

danlemmond
Copy link
Contributor

@danlemmond danlemmond commented Dec 16, 2020

_break_at_compile was no longer in use after changes to compile.cpp.
Change compile.cpp and c1_Compilation.cpp to use env()->break_at_compile() instead
to make that code no longer dead.
No new code, and Tier1 tests succeed after code is removed.

Bug: https://bugs.openjdk.java.net/browse/JDK-8255216


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8255216: Change _directive->BreakAtCompileOption to env()->break_at_compile()

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1806/head:pull/1806
$ git checkout pull/1806

@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Dec 16, 2020
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 16, 2020

Hi @danlemmond, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user danlemmond" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

openjdk bot commented Dec 16, 2020

@danlemmond The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Dec 16, 2020
@danlemmond
Copy link
Contributor Author

/covered

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Dec 16, 2020
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 16, 2020

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@@ -2224,7 +2223,6 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, compiler_name(task_level));
}

should_break = directive->BreakAtExecuteOption || task->check_break_at_flags();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CompileTask::check_break_at_flags is dead code too, and CIBreakAtOSR, CIBreakAt
they are all defunct right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure whether or not we wanted to roll the removal of all dead code into this issue or just _break_at_compile. The JBS issue specifically mentions _break_at_compile so that's what I removed here - can expand to do other stuff if you think it's a good idea.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to remove all that dead code with this issue

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should CIBreakAtOSR and CIBreakAt be removed too, or is it a bug that these flags are ignored?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fact that these flags are not working proves that no one is using them and therefore they should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally it was used to break into debugger during compilation:
http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/fffb29a53519/src/share/vm/opto/compile.cpp#l2104

In JDK 9 it was replaced with Compiler directive which skips compilation's ciEnv and consult CompilerOracle directly:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/compile.cpp#L2099

So I think cleaning ciEnv is fine.

I think it is bug that task->check_break_at_flags() is ignored. I used CIBreakAtOSR and CIBreakAt during debugging long ago before directives were introduced. I think it should be fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fact that these flags are not working proves that no one is using them and therefore they should be removed.

I tried to use BreakAtExecute recently, thinking it would generate a break in the generated code, but it didn't work, so I ended up using "break", which if I recall also sets a breakpoint when the method is compiled. I like having the choice of "break during compile" vs "break in generated code".

@robilad
Copy link

robilad commented Dec 17, 2020

Please send an e-mail to dalibor.topic@oracle.com so that I can mark your account as verified.

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Jan 4, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 4, 2021
@mlbridge
Copy link

mlbridge bot commented Jan 4, 2021

Webrevs

@@ -2224,7 +2223,6 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, compiler_name(task_level));
}

should_break = directive->BreakAtExecuteOption || task->check_break_at_flags();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally it was used to break into debugger during compilation:
http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/file/fffb29a53519/src/share/vm/opto/compile.cpp#l2104

In JDK 9 it was replaced with Compiler directive which skips compilation's ciEnv and consult CompilerOracle directly:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/compile.cpp#L2099

So I think cleaning ciEnv is fine.

I think it is bug that task->check_break_at_flags() is ignored. I used CIBreakAtOSR and CIBreakAt during debugging long ago before directives were introduced. I think it should be fixed.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify about my comment about task->check_break_at_flags(). The easier fix I think is instead of removing ciEnv code use env()->break_at_compile() in compile.cpp instead of directive->BreakAtCompileOption

@danlemmond danlemmond force-pushed the JDK-8255216 branch 2 times, most recently from bbbda14 to efbd3e4 Compare January 8, 2021 18:31
_break_at_compile is no longer in use and can be safely removed.
No new code, and Tier1 tests succeed after code is removed.

Bug: https://bugs.openjdk.java.net/browse/JDK-8255216
Move to env()->break_at_compile() in compile.cpp
@navyxliu
Copy link
Member

@danlemmond , I understand Kozlov's comment.

your change 36bc753 covers c2's optimization. There are another 2 places refer to _directive->BreakAtCompileOption. I think you need to change them to env()-> break_at_compile as well.

https://github.com/openjdk/jdk/blob/master/src/hotspot/share/c1/c1_Compilation.cpp#L449
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/compile.cpp#L506

@vnkozlov
Copy link
Contributor

@danlemmond , I understand Kozlov's comment.

your change 36bc753 covers c2's optimization. There are another 2 places refer to _directive->BreakAtCompileOption. I think you need to change them to env()-> break_at_compile as well.

https://github.com/openjdk/jdk/blob/master/src/hotspot/share/c1/c1_Compilation.cpp#L449
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/compile.cpp#L506

Yes, these places should be fixed too.

@vnkozlov
Copy link
Contributor

I would also suggest to change RFE (and this PR) Subject and Description if you do that.

Repurpose to env()->break_at_compile()
@danlemmond danlemmond changed the title 8255216: ciEnv::_break_at_compile isn't in use 8255216: Change _directive->BreakAtCompileOption to env()->break_at_compile() Jan 21, 2021
@navyxliu
Copy link
Member

Currently ciEnv->break_at_compile() is set if directive->BreakAtExecuteOption || task->check_break_at_flags();
It doesn't consider C->directive()->BreakAtCompileOption. IMHO, this line should include || directive->BreakAtCompileOption.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good.

@openjdk
Copy link

openjdk bot commented Jan 21, 2021

⚠️ @danlemmond the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout JDK-8255216
$ git commit -c user.name='Preferred Full Name' --allow-empty -m 'Update full name'
$ git push

@openjdk
Copy link

openjdk bot commented Jan 21, 2021

@danlemmond This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8255216: Change _directive->BreakAtCompileOption to env()->break_at_compile()

Reviewed-by: kvn, phh

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 233 new commits pushed to the master branch:

  • 5aca934: 8260304: (se) EPollSelectorImpl wakeup mechanism broken on Linux 32-bit
  • 53fecba: 8258805: Japanese characters not entered by mouse click on Windows 10
  • a887177: 8246788: ZoneRules invariants can be broken
  • 874aef4: 8259707: LDAP channel binding does not work with StartTLS extension
  • c5ad713: 8260250: Duplicate check in DebugInformationRecorder::recorders_frozen
  • bf5e801: 8259922: MethodHandles.collectArguments does not throw IAE if pos is outside the arity range
  • 0ea5862: 8260053: Optimize Tokens' use of Names
  • 18eb6d9: 8255348: NPE in PKIXCertPathValidator event logging code
  • a97f3c1: 8258853: Support separate function declaration and definition with ENABLE_IF-based SFINAE
  • 154e1d6: 8259009: G1 heap summary should be shown in "Heap Parameters" window on HSDB
  • ... and 223 more: https://git.openjdk.java.net/jdk/compare/090bd3afc37555582bde61d03e2e32350ae5d714...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@vnkozlov, @phohensee) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 21, 2021
@vnkozlov
Copy link
Contributor

Currently ciEnv->break_at_compile() is set if directive->BreakAtExecuteOption || task->check_break_at_flags();
It doesn't consider C->directive()->BreakAtCompileOption. IMHO, this line should include || directive->BreakAtCompileOption.

Okay. This is totally messed up :(

BreakAtExecuteOption should be only used in https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/output.cpp#L376
to set break point in compiled code.

Pointed compileBroker.cpp#L2226 line should use BreakAtCompileOption instead of BreakAtExecuteOption.
@danlemmond you need additional change in compileBroker.cpp to replace BreakAtExecuteOption with BreakAtCompileOption.

Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need additional change in compileBroker.cpp

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Jan 21, 2021
BreakAtExecuteOption should not be used here, instead use
BreakAtCompileOption
Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. Finally.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 22, 2021
@danlemmond
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 22, 2021
@openjdk
Copy link

openjdk bot commented Jan 22, 2021

@danlemmond
Your change (at version 783635d) is now ready to be sponsored by a Committer.

@phohensee
Copy link
Member

/sponsor

@openjdk openjdk bot closed this Jan 22, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed sponsor Pull request is ready to be sponsored ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 22, 2021
@openjdk
Copy link

openjdk bot commented Jan 22, 2021

@phohensee @danlemmond Since your change was applied there have been 233 commits pushed to the master branch:

  • 5aca934: 8260304: (se) EPollSelectorImpl wakeup mechanism broken on Linux 32-bit
  • 53fecba: 8258805: Japanese characters not entered by mouse click on Windows 10
  • a887177: 8246788: ZoneRules invariants can be broken
  • 874aef4: 8259707: LDAP channel binding does not work with StartTLS extension
  • c5ad713: 8260250: Duplicate check in DebugInformationRecorder::recorders_frozen
  • bf5e801: 8259922: MethodHandles.collectArguments does not throw IAE if pos is outside the arity range
  • 0ea5862: 8260053: Optimize Tokens' use of Names
  • 18eb6d9: 8255348: NPE in PKIXCertPathValidator event logging code
  • a97f3c1: 8258853: Support separate function declaration and definition with ENABLE_IF-based SFINAE
  • 154e1d6: 8259009: G1 heap summary should be shown in "Heap Parameters" window on HSDB
  • ... and 223 more: https://git.openjdk.java.net/jdk/compare/090bd3afc37555582bde61d03e2e32350ae5d714...master

Your commit was automatically rebased without conflicts.

Pushed as commit 7be9113.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@danlemmond danlemmond deleted the JDK-8255216 branch March 2, 2021 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
7 participants